class DateUtil{
// JavaScript Documentclass DateUtil{
    /**
     * 例如:2017-06-28 10:48:46转成date类,
     * 可把- replace成/
     * @param dateString
     * @return Date
     */
    static parserDateString(dateString){
        if(dateString){
            let regEx = new RegExp("\\-","gi");
            let validDateStr=dateString.replace(regEx,"/");
            let milliseconds=Date.parse(validDateStr);
            return new Date(milliseconds);

        }
    }
	
	static myformatter(date){  
    	var strDate = date.getFullYear()+"-";
        if(date.getMonth()<10){
			var s = date.getMonth()+1+"-";
			strDate += s;
		}else{
			strDate += date.getMonth()+1+"-";
		}
        if(date.getDate()<10){
             strDate += "0"+date.getDate();
        }else{
			strDate += date.getDate();
        }
		return strDate ;
    } 
}
export default DateUtil;